﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Slb.Ocean.Core;

namespace Public.Ocean.Petrel.Extensions.UnitTest
{
    class DelegateLocator : IPerTypeServiceProvider
    {
        Func<Type, object> locator;
        public DelegateLocator()
        {
            this.locator = type => null;
        }

        public DelegateLocator(Func<Type, object> locator)
        {
            this.locator = locator;
        }

        public object GetService(object source, Type serviceType)
        {
            return locator(serviceType);
        }

        public object GetService(Type sourceType, Type serviceType)
        {
            return locator(serviceType);
        }
    }
}
